From: Antoine Musso Date: Sat, 6 Jan 2007 15:31:39 +0000 (+0000) Subject: Fix #8417 : Handle EXIF unknown date X-Git-Tag: 1.31.0-rc.0~54645 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=3a459112d76d1775af3100667e38db00bfdcd256;p=lhc%2Fweb%2Fwiklou.git Fix #8417 : Handle EXIF unknown date --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7831b8ce0d..192b7b5eb4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -469,6 +469,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN on upgrade. * Recentchanges RSS/Atom feeds now use a separate message for the description to avoid cluttering it with useless wiki formatting +* (bug 8417) Handle EXIF unknown dates == Languages updated == diff --git a/includes/Exif.php b/includes/Exif.php index e21b4d9ef7..0860d5f7e5 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -731,7 +731,9 @@ class FormatExif { case 'DateTime': case 'DateTimeOriginal': case 'DateTimeDigitized': - if( preg_match( '/^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)$/', $val ) ) { + if( $val == '0000:00:00 00:00:00' ) { + $tags[$tag] = wfMsg('exif-unknowndate'); + } elseif( preg_match( '/^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)$/', $val ) ) { $tags[$tag] = $wgLang->timeanddate( wfTimestamp(TS_MW, $val) ); } break; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index fea5c6682b..3d9146dd82 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2384,6 +2384,8 @@ is collapsed. Others will be hidden by default. 'exif-compression-1' => 'Uncompressed', 'exif-compression-6' => 'JPEG', +'exif-unknowndate' => 'Unknown date', + 'exif-photometricinterpretation-2' => 'RGB', 'exif-photometricinterpretation-6' => 'YCbCr',